package asia.gkc.test.util;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

/**
 * File Name: ByteBufToBytes.java
 * Function:
 *
 * @author jakes.
 * @version 1.0
 * @since 6/27/16 8:14 AM
 */

public class ByteBufToBytes {
    public static byte[] toBytes(ByteBuf datagram) {
        byte[] data = new byte[datagram.readableBytes()];
        datagram.readBytes(data);
        return data;
    }
}
